import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
// import Webgl from '../views/Webgl.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue')
    },
    {
      path: '/threeCreate',
      name: 'threeCreate',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/ThreeCreate/index.vue')
    },
    {
      path: '/webgl',
      name: 'webgl',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/Webgl/index.vue'),
      children: [
        {
          name: 'webgl1',
          path: 'webgl1',
          component: () => import('../views/Webgl/index1.vue'),
          meta: {
            title: '动态绘制不同颜色点',
          }
        }, {
          name: 'webgl2',
          path: 'webgl2',
          component: () => import('../views/Webgl/index2.vue'),
          meta: {
            title: '绘制基本图形',
          }
        },{
          name: 'webgl3',
          path: 'webgl3',
          component: () => import('../views/Webgl/index3.vue'),
          meta: {
            title: '绘制彩色三角形',
          }
        },{
          name: 'webgl4',
          path: 'webgl4',
          component: () => import('../views/Webgl/index4.vue'),
          meta: {
            title: '绘制彩色基本图形',
          }
        },{
          name: 'webgl5',
          path: 'webgl5',
          component: () => import('../views/Webgl/index5.vue'),
          meta: {
            title: '绘制黄色正方形',
          }
        },{
          name: 'webgl6',
          path: 'webgl6',
          component: () => import('../views/Webgl/index6.vue'),
          meta: {
            title: '绘制抗拒黄色正方形',
          }
        },{
          name: 'webgl7',
          path: 'webgl7',
          component: () => import('../views/Webgl/index7.vue'),
          meta: {
            title: '使用纹理绘制图形',
          }
        },{
          name: 'webgl8',
          path: 'webgl8',
          component: () => import('../views/Webgl/index8.vue'),
          meta: {
            title: '绘制可缩放的纹理图形',
          }
        },{
          name: 'webgl9',
          path: 'webgl9',
          component: () => import('../views/Webgl/index9.vue'),
          meta: {
            title: '会动的三角形',
          }
        },{
          name: 'webgl10',
          path: 'webgl10',
          component: () => import('../views/Webgl/index10.vue'),
          meta: {
            title: '旋转的三角形',
          }
        },
      ]
    }
  ]
})

export default router
